package com.faxsun.web.controller.admin;

import java.util.List;

import mblog.web.controller.BaseController;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.faxsun.core.readonly.entity.ProductRO;
import com.faxsun.core.readonly.service.ProductShopService;

@Controller
@RequestMapping("/admin/sync")
public class SyncShopController extends BaseController{

	@Autowired
	ProductShopService productShopService;
	
	@RequestMapping("/list")
	public @ResponseBody List<ProductRO> list() {
		return productShopService.list();
	}
	
	@RequestMapping("/product")
	@ResponseBody
	public String sync(){
		productShopService.syncProduct();
		return "{ret:success}";
	}
}
